package ysm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import ysm.entity.Registergraduates;
import ysm.service.RegistergraduatesService;

@RestController
@RequestMapping("/public")
public class RegistergraduatesController {

	@Autowired
	private RegistergraduatesService registergraduatesService;
	
	@RequestMapping("/deleteRGByPrimaryKey")
	public void deleteByPrimaryKey(Integer id) {
		registergraduatesService.deleteByPrimaryKey(id);
	}

	@RequestMapping("/insertRG")
	public void insert(Registergraduates record) {
		registergraduatesService.insert(record);
	}

	@RequestMapping("/insertRGSelective")
	public void insertSelective(Registergraduates record) {
		registergraduatesService.insertSelective(record);
	}

	@RequestMapping("/selectRGByPrimaryKey")
    public Registergraduates selectByPrimaryKey(Integer id) {
    	return registergraduatesService.selectByPrimaryKey(id);
    }
	
	@RequestMapping("/selectRGByUid")
    public Registergraduates selectRGByUid(Integer uid) {
    	return registergraduatesService.selectRGByUid(uid);
    }

	@RequestMapping("/updateRGByPrimaryKeySelective")
    public void updateByPrimaryKeySelective(Registergraduates record) {
    	registergraduatesService.updateByPrimaryKeySelective(record);
    }

	@RequestMapping("/updateRGByPrimaryKey")
    public void updateByPrimaryKey(Registergraduates record) {
    	registergraduatesService.updateByPrimaryKey(record);
    }
    
	@RequestMapping("/loadAllRG")
    public List loadAllRG() {
    	return registergraduatesService.loadAllRG();
    }
	
	@RequestMapping("/userUpdateRGByPrimaryKey")
    public void userUpdateRGByPrimaryKey(Registergraduates record) {
    	if (record.getId() == null) {
    		registergraduatesService.insertSelective(record);
    	} else {
    		registergraduatesService.updateByPrimaryKeySelective(record);
    	}
    }
}
